package service.impl;

import dao.ChargeDao;
import entity.Charge;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.ChargeService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("chargeServiceImpl")
public class ChargeServiceImpl implements ChargeService {

    @Autowired
    private ChargeDao chargeDao;
    @Override
    public List<Charge> query(Charge charge,int pageSize, int pageNumber) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("pName",charge.getpName());
        map.put("chargeDate",charge.getChargeDate());
        map.put("state",charge.getState());
        map.put("offset",(pageNumber-1)*pageSize);
        map.put("limit",pageSize);
        return chargeDao.query(map);
    }
}
